<#macro pager src_url curr_pg total_pg>
<div class="pagination">
	<ul>
	<#if curr_pg!=1>
		<li><a class="" title="First" href="${src_url}?page=1">&lt;&lt;</a></li>
		<li><a class="" title="Previous" href="${src_url}?page=${curr_pg-1}">&lt;</a></li>
	<#else>
		<li class="disabled"><a href="javascript:void(0)">&lt;&lt;</a></li>
		<li class="disabled"><a href="javascript:void(0)">&lt;</a></li>
	</#if>
	
	<#assign start_pg = 1>
	<#if (curr_pg-3) &gt; 1>
		<#assign start_pg = (curr_pg-3)>
	</#if>
	
	<#assign end_pg = total_pg>
	<#if (curr_pg+3) &lt; total_pg>
		<#assign end_pg = (curr_pg+3)>
	</#if>
	
	<#list start_pg..end_pg as pg>
		<#if pg==curr_pg>
			<li class="disabled"><a href="javascript:void(0)">${pg}</a></li>
		<#else>
			<li><a href="${src_url}?page=${pg}">${pg}</a></li>
		</#if>
	</#list>
	
	<#if curr_pg!=total_pg>
		<li><a class="" title="Next" href="${src_url}?page=${curr_pg+1}">&gt;</a></li>
		<li><a class="" title="Last"href="${src_url}?page=${total_pg}">&gt;&gt;</a></li>
	<#else>
		<li class="disabled"><a href="javascript:void(0)">&gt;</a></li>
		<li class="disabled"><a href="javascript:void(0)">&gt;&gt;</a></li>
	</#if>
	
	<li>
		<div style="display:inline;margin-left:5px;">
			To:<input type="text" id="pager_input" style="width:25px;"/>
			<a href="javascript:void(0)" onclick="javascript:if($('#pager_input').val()!='') this.href='${src_url}?page='+$('#pager_input').val();">Go</a>
		</div>
	</li>
	</ul>
</div>
</#macro>
